package demo07.remote.control;

import demo07.remote.command.CeilingFanOffCommand;
import demo07.remote.command.CeilingFanOnCommand;
import demo07.remote.command.GarageDoorDownCommand;
import demo07.remote.command.GarageDoorUpCommand;
import demo07.remote.command.LightOffCommand;
import demo07.remote.command.LightOnCommand;
import demo07.remote.command.StereoOffCommand;
import demo07.remote.command.StereoOnWithCDCommand;
import demo07.remote.object.CeilingFan;
import demo07.remote.object.GarageDoor;
import demo07.remote.object.Light;
import demo07.remote.object.Stereo;

public class RemoteLoaderTest {
	public static void main(String[] args) {
		RemoteControl remoteControl = new RemoteControl();
 
		Light livingRoomLight = new Light("客厅");
		Light kitchenLight = new Light("厨房");
		CeilingFan ceilingFan= new CeilingFan("客厅");
		GarageDoor garageDoor = new GarageDoor("车库");
		Stereo stereo = new Stereo("客厅");
  
		LightOnCommand livingRoomLightOn = 
				new LightOnCommand(livingRoomLight);
		LightOffCommand livingRoomLightOff = 
				new LightOffCommand(livingRoomLight);
		LightOnCommand kitchenLightOn = 
				new LightOnCommand(kitchenLight);
		LightOffCommand kitchenLightOff = 
				new LightOffCommand(kitchenLight);
  
		CeilingFanOnCommand ceilingFanOn = 
				new CeilingFanOnCommand(ceilingFan);
		CeilingFanOffCommand ceilingFanOff = 
				new CeilingFanOffCommand(ceilingFan);
 
		GarageDoorUpCommand garageDoorUp =
				new GarageDoorUpCommand(garageDoor);
		GarageDoorDownCommand garageDoorDown =
				new GarageDoorDownCommand(garageDoor);
 
		StereoOnWithCDCommand stereoOnWithCD =
				new StereoOnWithCDCommand(stereo);
		StereoOffCommand  stereoOff =
				new StereoOffCommand(stereo);
 
		remoteControl.setCommand(0, livingRoomLightOn, livingRoomLightOff);
		remoteControl.setCommand(1, kitchenLightOn, kitchenLightOff);
		remoteControl.setCommand(2, ceilingFanOn, ceilingFanOff);
		remoteControl.setCommand(3, stereoOnWithCD, stereoOff);
  
		System.out.println(remoteControl);//输出该对象那个，将调用toString方法
 
		remoteControl.onButtonWasPushed(0);
		remoteControl.offButtonWasPushed(0);
		remoteControl.onButtonWasPushed(1);
		remoteControl.offButtonWasPushed(1);
		remoteControl.onButtonWasPushed(2);
		remoteControl.offButtonWasPushed(2);
		remoteControl.onButtonWasPushed(3);
		remoteControl.offButtonWasPushed(3);
	}
/*	------ 远程控制 -------
[位置 0] 开启类demo07.remote.command.LightOnCommand   关闭类 demo07.remote.command.LightOffCommand
[位置 1] 开启类demo07.remote.command.LightOnCommand   关闭类 demo07.remote.command.LightOffCommand
[位置 2] 开启类demo07.remote.command.CeilingFanOnCommand   关闭类 demo07.remote.command.CeilingFanOffCommand
[位置 3] 开启类demo07.remote.command.StereoOnWithCDCommand   关闭类 demo07.remote.command.StereoOffCommand
[位置 4] 开启类demo07.remote.nocommand.NoCommand   关闭类 demo07.remote.nocommand.NoCommand
[位置 5] 开启类demo07.remote.nocommand.NoCommand   关闭类 demo07.remote.nocommand.NoCommand
[位置 6] 开启类demo07.remote.nocommand.NoCommand   关闭类 demo07.remote.nocommand.NoCommand

	客厅 灯亮了
	客厅 灯灭了
	厨房 灯亮了
	厨房 灯灭了
	客厅 吊扇在高档
	客厅 关闭吊扇
	客厅 立体声是开着的
	客厅 立体声设置为CD输入。
	客厅 立体声音量设置为 11
	客厅 立体声是关闭的
	*/
}
